import java.util.*;
import javax.sound.midi.MidiUnavailableException;

public class MajorScale extends Scale
{
	public MajorScale(Pitch root)
	{
		scale = new ArrayList<Pitch>();
		
		Pitch probe = root;
		
		scale.add(probe); // P1
		
		for (int i=0; i < 7; i++)
		{
			if (i == 2 || i == 6) // half step
				probe = new Pitch(probe.freq.next());
			else // whole step
				probe = new Pitch(probe.freq.next().next());
			
			scale.add(probe);
		}
	}
	
	public Scale octaveUp()
	{
		return new MajorScale(new Pitch(scale.get(0).freq.octaveUp()));
	}
	
	public static void main(String[] args) throws SyntaxErrorException, MidiUnavailableException
	{
		Scale C = new MajorScale(new Pitch("C4"));
		
		int delay = 500;
		C.play(delay);
		C.arpeggiate(delay);
	}
}
